package com.warrior.gatherweb.controller;

import com.alibaba.fastjson.JSONArray;
import com.warrior.gatherweb.dto.GatherDataPageDto;
import com.warrior.gatherweb.exceptionhandler.ApplicationException;
import com.warrior.gatherweb.service.GatherDataService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName com.warrior.gatherweb.controller.GatherDataController.java
 * @Author xujian
 * @Description
 * @CreateTime 2021年01月04日 17:26:00
 */
@RestController
@RequestMapping("data")
@Api(tags = "采集数据接口")
public class GatherDataController {

    @Autowired
    private GatherDataService gatherDataService;

    @PostMapping("/page")
    public CommonResult getGatherDataByPage(@RequestBody GatherDataPageDto params) throws ApplicationException {
        JSONArray result = gatherDataService.getGatherDataByPage(params);
        return CommonResponse.success(result);
    }

}
